import http from '@/utils/http'

interface IPageInfo {
  offset: number;
  limit: number;
}

export interface IStudent {
  birthday: string;
  height: number;
  idCard: string;
  name: string;
  sex: number;
  weight: number;
}

// 查询学生列表
export function getStudentList(payload: IPageInfo) {
  return http.get('/student', { params: payload })
}

// 新增学生列表
export function addStudent(payload: IStudent) {
  return http.post('/student', payload)
}

// 修改学生信息
export function updateStudent(id: number, payload: IStudent) {
  return http.put(`/student?id=${id}`, payload)
}

// 删除学生信息
export function deleteStudent(id: number) {
  return http.delete(`/student/${id}`)
}
